<?php

echo "hello<br/>";
$today = new DateTime();
$yesterday = date("Y-m-d", strtotime("yesterday"));

$beginOfCurrentMonth = new DateTime();
$beginOfCurrentMonth->modify('first day of this month');

$lastMonth =date("Y-m-d", strtotime("-1 day"));
$beginOfLastMonth=new DateTime($lastMonth);
$beginOfLastMonth->modify('first day of this month');
$lastOfLastMonth=new DateTime($lastMonth);
$lastOfLastMonth->modify('last day of this month');

echo $yesterday."<br/>";
echo $beginOfCurrentMonth->format('Y-m-d')."<br/>";
echo $today->format('Y-m-d')."<br/>";
echo $beginOfLastMonth->format('Y-m-d')."<br/>";
echo $lastOfLastMonth->format('Y-m-d')."<br/>";

?>